// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

import daohang from "./layout/daohang";
Vue.component('daohang',daohang)


// import ElemnetUI from 'element-ui'  // 1.引入组件
// import 'element-ui/lib/theme-chalk/index.css'
// 2. 申明使用组件
// Vue.use(ElemnetUI)


import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
Vue.use(Antd);



// import { config } from 'vue/types/umd'





// 3. 设置基本路由
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:8000/'

// 4. 把axios设置为全局
Vue.prototype.$axios = axios

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

// // 3. 请求拦截---每次向后端发送请求时，在请求头中携带token值
// axios.interceptors.request.use(config => {

//   // 判断是否存在token
//   if (sessionStorage.getItem('token')) {
//     config.headers['Authorization'] = sessionStorage.getItem('token')
//   }

// })



